package tuanda.soict.firstsun.DataPackage;

/**
 * @author tuanda_soict_hut
 * @version 0.0.1
 * @since 24-8-2012
 */
public enum EnvironmentDataSet implements CommonConstants {

    ROAD(0, "ROAD", 0, 0, LAND_TYPE),
    FIELD(1, "FIELD", 5, 0, LAND_TYPE),
    JUNGLE(2, "JUNGLE", 10, 1, LAND_TYPE),
    MOUNTAIN(3, "MOUNTAIN", 15, 2, LAND_TYPE),
    HILL(4, "HILL", 15, 1, LAND_TYPE),
    RIVER(5, "RIVER", 0, 3, SEA_TYPE + LAND_TYPE),
    SEA(6, "SEA", 0, 0, SEA_TYPE);
    private final String name;
    private final int defense;
    private final int obstaclePoint;
    private final int category;
    private final int ID;

    private EnvironmentDataSet(int id, String nam, int def, int obsPoint, int cat) {
        ID = id;
        name = nam;
        defense = def;
        obstaclePoint = obsPoint;
        category = cat;
    }

    public final int getID() {
        return this.ID;
    }

    public final int getDefense() {
        return this.defense;
    }

    public final String getName() {
        return this.name;
    }

    public final int getObstaclePoint() {
        return this.obstaclePoint;
    }

    public final int getCategory() {
        return this.category;
    }

    public final EnvironmentDataSet getEnvironmentData(int id) {
        for (EnvironmentDataSet env : EnvironmentDataSet.values()) {
            if (env.getID() == id) {
                return env;
            }
        }
        return EnvironmentDataSet.ROAD;
    }
}
